"""author: wenyao
   data: 2022/3/12
   project: pirate-king-2022
"""
# prompt = "Today is a hot day"
# # dir => 查看对象有什么方法（可以做什么）
# print(dir(prompt))
# print(dir(str))
#
# # help => 查看方法如何用
# # help(对象.方法)
# help(prompt.title)
# print(prompt.title())
#
#
# mystr = "1234"
# print(mystr.isdigit())
# mystr = "1234一二三"
# print(mystr.isnumeric())
# mystr = "Hello World!"
# print(mystr.istitle())
# mystr = "我是cali"
# print(mystr.isalpha())
#
# # 标识符 => 变量名
# mystr = "_"
# print(mystr.isidentifier())

# mystr = "Today is a hot day!"
# print(mystr.startswith("Today"))
# print(mystr.startswith("hot",11))
# print(mystr.endswith("day!"))


# mystr = "Today is a hot day!"
# print(len(mystr))
# print(mystr.count("ay"))
# print(mystr.index("day"))
# print(mystr.find("day"))

### 转换类
# mystr = "Today is a hot day!"
# print(mystr.upper())
# print(mystr.lower())
# print(mystr.title())
#
# # split => 切割字符串 => 默认分隔符为一个或多个空格
# mystr = "cali##18##female"
# print(mystr.split('##'))
# # ['cali', '18', 'female']
# # 列表
# mystr = "cali 18    female"
# print(mystr.split())
#
# # join => 将序列拼接大字符串
# mylist = ['cali', '18', 'female']
# # "cali##18##female"
# # "分隔符".join(列表)
# print("##".join(mylist))
#
# # strip 去除首尾指定的字符，默认空白字符
# # 输入邮箱：   linuxzhen520@163.com
# my_email = " linuxzhen520@163.com "
# print(my_email.strip())
# my_email = "linouxzhen520@163.cmom"
# # nouxzhen520@163.c
# print(my_email.strip("limo"))
# my_email = " linouxzheniiii520@163.cmom  "
# print(my_email.strip("li mo"))
#
# # replace 查找替换
# mystr = "Today is a hot day! d"
# print(mystr.replace("day", "Day"))
# print(mystr.replace("day", "Day", 1))
#
#
# str1 = "welcome here"
# str2 = "choice1"
# print(str1.center(30,"#"))
# print(str2.rjust(30, "."))
# print(str2.ljust(30, "."))
#
#
# s = "i,am,lilei"
# print(s.replace(',',' '))
# print(" ".join(s.split(',')))
# print(s[5:])
# print(s[-5:])
# print(s.upper())
# print(s.lower())
mystr = "Today is a hot day!"
print(mystr.upper())
print(mystr.lower())
print(mystr.title())

# split => 切割字符串 => 默认分隔符为一个或多个空格
mystr = "cali##18##female"
print(mystr.split('##'))
# ['cali', '18', 'female']
# 列表
mystr = "cali 18    female"
print(mystr.split())

# join => 将序列拼接大字符串
mylist = ['cali', '18', 'female']
# "cali##18##female"
# "分隔符".join(列表)
print(" ".join(mylist))

# strip 去除首尾指定的字符，默认空白字符
# 输入邮箱：   linuxzhen520@163.com
my_email = " linuxzhen520@163.com "
print(my_email.strip())
my_email = "linouxzhen520@163.cmom"
# nouxzhen520@163.c
print(my_email.strip("limo"))
my_email = " linouxzheniiii520@163.cmom  "
print(my_email.strip("li mo"))

# replace 查找替换
mystr = "Today is a hot day! d"
print(mystr.replace("day", "Day"))
print(mystr.replace("day", "Day", 1))


str1 = "welcome here"
str2 = "choice1"
print(str1.center(30,"#"))
print(str2.rjust(30, "."))
print(str2.ljust(30, "."))


s = "i,am,lilei"
print(s.replace(',',' '))
print(" ".join(s.split(',')))
print(s[5:])
print(s[-5:])
print(s.upper())
print(s.lower())
